package com.reds.backend.controller.adminController;

import com.reds.backend.utils.adminUtils.admin.StpAdminUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.reds.backend.service.admin.adminInfoService;

import java.util.Map;

@RestController
@RequestMapping("/adminInfo")
public class adminInfoController {
    @Autowired
    adminInfoService adminInfoService;

    @PostMapping("/getInfoByToken/")
    public Map<String,String> getInfoByToken(@RequestParam Map<String,String> map){
        StpAdminUtil.checkRoleOr("admin","superAdmin");
        return adminInfoService.getAdminInfo();
    }
    @PostMapping("/loginCheck/")
    public String loginCheck(@RequestParam Map<String,String> map){
        StpAdminUtil.checkRoleOr("admin","superAdmin");
        return adminInfoService.loginCheck();
    }
}
